import Vue from 'vue';
import Router from 'vue-router';
import system from './routerList/system';
import journal from './routerList/journal';
import rbac from './routerList/rbac';
Vue.use(Router);
export default new Router({
    // 首页跳转设置 默认跳转 
    routes: [
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '首页' },
            children: [...system,...journal,...rbac],
            redirect: 'xygl'
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: { title: '登录' }
        },
        {
            path: '/setPassword',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/setPassword.vue'),
            meta: { title: '修改密码' }
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});

const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}
